3.423 \(\int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx\)

Optimal. Leaf size=33 \[ \frac {a^2 \tan (c+d x)}{d}+\frac {2 a b \tanh ^{-1}(\sin (c+d x))}{d}+b^2 x \]

[Out]

b^2*x+2*a*b*arctanh(sin(d*x+c))/d+a^2*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.07, antiderivative size = 33, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {2789, 3770, 3012, 8} \[ \frac {a^2 \tan (c+d x)}{d}+\frac {2 a b \tanh ^{-1}(\sin (c+d x))}{d}+b^2 x \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Cos[c + d*x])^2*Sec[c + d*x]^2,x]

[Out]

b^2*x + (2*a*b*ArcTanh[Sin[c + d*x]])/d + (a^2*Tan[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2789

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Dist[(2*c*d)/b
, Int[(b*Sin[e + f*x])^(m + 1), x], x] + Int[(b*Sin[e + f*x])^m*(c^2 + d^2*Sin[e + f*x]^2), x] /; FreeQ[{b, c,
 d, e, f, m}, x]

Rule 3012

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*Cos[e
+ f*x]*(b*Sin[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rule 3770

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int (a+b \cos (c+d x))^2 \sec ^2(c+d x) \, dx &=(2 a b) \int \sec (c+d x) \, dx+\int \left (a^2+b^2 \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx\\ &=\frac {2 a b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 \tan (c+d x)}{d}+b^2 \int 1 \, dx\\ &=b^2 x+\frac {2 a b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a^2 \tan (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.08, size = 32, normalized size = 0.97 \[ \frac {a^2 \tan (c+d x)+2 a b \tanh ^{-1}(\sin (c+d x))+b^2 d x}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Cos[c + d*x])^2*Sec[c + d*x]^2,x]

[Out]

(b^2*d*x + 2*a*b*ArcTanh[Sin[c + d*x]] + a^2*Tan[c + d*x])/d

________________________________________________________________________________________

fricas [B]  time = 0.91, size = 74, normalized size = 2.24 \[ \frac {b^{2} d x \cos \left (d x + c\right ) + a b \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - a b \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + a^{2} \sin \left (d x + c\right )}{d \cos \left (d x + c\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^2*sec(d*x+c)^2,x, algorithm="fricas")

[Out]

(b^2*d*x*cos(d*x + c) + a*b*cos(d*x + c)*log(sin(d*x + c) + 1) - a*b*cos(d*x + c)*log(-sin(d*x + c) + 1) + a^2
*sin(d*x + c))/(d*cos(d*x + c))

________________________________________________________________________________________

giac [B]  time = 0.65, size = 77, normalized size = 2.33 \[ \frac {{\left (d x + c\right )} b^{2} + 2 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^2*sec(d*x+c)^2,x, algorithm="giac")

[Out]

((d*x + c)*b^2 + 2*a*b*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 2*a*b*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*a^2*t
an(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^2 - 1))/d

________________________________________________________________________________________

maple [A]  time = 0.08, size = 49, normalized size = 1.48 \[ b^{2} x +\frac {a^{2} \tan \left (d x +c \right )}{d}+\frac {2 a b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {c \,b^{2}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*cos(d*x+c))^2*sec(d*x+c)^2,x)

[Out]

b^2*x+a^2*tan(d*x+c)/d+2/d*a*b*ln(sec(d*x+c)+tan(d*x+c))+1/d*c*b^2

________________________________________________________________________________________

maxima [A]  time = 0.42, size = 48, normalized size = 1.45 \[ \frac {{\left (d x + c\right )} b^{2} + a b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + a^{2} \tan \left (d x + c\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))^2*sec(d*x+c)^2,x, algorithm="maxima")

[Out]

((d*x + c)*b^2 + a*b*(log(sin(d*x + c) + 1) - log(sin(d*x + c) - 1)) + a^2*tan(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 0.57, size = 181, normalized size = 5.48 \[ \frac {2\,b^2\,\mathrm {atan}\left (\frac {64\,b^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{256\,a^2\,b^4+64\,b^6}+\frac {256\,a^2\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{256\,a^2\,b^4+64\,b^6}\right )}{d}-\frac {2\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}+\frac {4\,a\,b\,\mathrm {atanh}\left (\frac {128\,a\,b^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{512\,a^3\,b^3+128\,a\,b^5}+\frac {512\,a^3\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{512\,a^3\,b^3+128\,a\,b^5}\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*cos(c + d*x))^2/cos(c + d*x)^2,x)

[Out]

(2*b^2*atan((64*b^6*tan(c/2 + (d*x)/2))/(64*b^6 + 256*a^2*b^4) + (256*a^2*b^4*tan(c/2 + (d*x)/2))/(64*b^6 + 25
6*a^2*b^4)))/d - (2*a^2*tan(c/2 + (d*x)/2))/(d*(tan(c/2 + (d*x)/2)^2 - 1)) + (4*a*b*atanh((128*a*b^5*tan(c/2 +
 (d*x)/2))/(128*a*b^5 + 512*a^3*b^3) + (512*a^3*b^3*tan(c/2 + (d*x)/2))/(128*a*b^5 + 512*a^3*b^3)))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \cos {\left (c + d x \right )}\right )^{2} \sec ^{2}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*cos(d*x+c))**2*sec(d*x+c)**2,x)

[Out]

Integral((a + b*cos(c + d*x))**2*sec(c + d*x)**2, x)

________________________________________________________________________________________